<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
    //1.创建一个AO(activation object)对象:临时存储容器
        //2.找形参和变量声明，值赋予undefined
        //3.将形参与实参的值统一 
        //4.找函数声明，值赋予函数体
        1.
        global = 100;
        function fn(){
            console.log(global);//undefined
            global = 200;
            console.log(global);//200
            var global =300;
        }
        fn();
        var global;


        2.
        a = 100;
        function test(e){
            function e() {}
            arguments[0] = 2;
            console.log(e);//2
            if(a){
                var b = 12
        }
            var c;
            a =10;
            var a;
            console.log(b);//undefined
            f = 123;
            console.log(c);//undefined
            console.log(f);//123
        }
        test(a)
    </script>
</body>
</html>